<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎页</title>
    <link rel="stylesheet" href="static/layui/css/layui.css">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
  <h1> 欢迎进入虎虎图书馆</h1>
</body>
</html>
<script src="static/layui/layui.js"></script>
<script>
    layui.use(['jquery','layer'],function () {
        var $=layui.jquery;
        var layer=layui.layer;
        $(function () {
            $.ajax({
                url:"./order/judge.do?flag=no",
                type:"get",
                dataType:"json",
                success:function (data) {
                    if(data.stringList=="null"){
                        console.log("为空");
                    }else {
                        var stringList=data.stringList;
                        layer.confirm('您预定的书籍'+stringList+'上架了是否申请借阅？', {
                            btn: ['确定', '取消'] //可以无限个按钮
                            ,
                        }, function(index, layero){
                            //按钮【确定】的回调
                            console.log("确定");
                            $.ajax({
                                url:"./order/judge.do",
                                type:"get",
                                data:{
                                    flag:"yes"
                                },
                            });
                            layer.close(index);
                        }, function(index){
                            //按钮【取消】的回调
                            console.log("取消");
                        });
                    }
                }
            })

        })
    })
</script>